package com.mls.fivedistrict.server;

import com.mls.fivedistrict.common.PageFilter;
import com.mls.fivedistrict.common.ServiceResponse;
import com.mls.fivedistrict.pojo.Record;
import com.mls.fivedistrict.pojo.RecordAndIntegral;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by nanji on 2018/3/16.
 */
public interface RecordService {
    public ServiceResponse addRecord(Record record);

    public ServiceResponse deleteRecord(Long recordId);

    public ServiceResponse getRecordList(PageFilter filter);

    ServiceResponse getRecordListByApp(PageFilter filter);

    List<Record> getRecordListSingle(PageFilter pageFilter);

    List<Record> getRecordListByTask();

    ServiceResponse editRecord(Record record);

    Record getRecordDetail(Long recordId);

    int insertBash(List<Record> list);

    /**
     * 领取积分
     *
     * @param record
     * @return
     */
    int acceptRecord(Long recordId, Long userId);

    /**
     * 计算已领取的积分总和
     *
     * @return
     */
    BigDecimal getRecordSum();

    int insertSelect(Record record);

    int insertRecord(Record record);

    /**
     * 通过资产ID获取记录列表
     *
     * @param propertyId
     * @return
     */
    List<Record> getRecordListByPropertyId(Long propertyId);

    /**
     * 通过用户ID获取记录列表
     *
     * @param userId
     * @return
     */
    List<Record> getRecordListByUserId(Long userId);

    /**
     * 批量更新删除
     *
     * @param recordList
     */
    void deleteBatch(List<Record> recordList);

    List<Record> getRecordList(Long integralId, Long userId);

    /**
     * 获取记录和积分
     *
     * @param params
     * @return
     */
    List<RecordAndIntegral> searchAndIntegral(Map<String, String> params);

    /**
     * 删除转移的记录
     *
     * @param maxId
     */
    int deleteTransferRecord(Date createDate);

    void recycleBatch(List<Record> recordList);

    int updateRecordForReceive(Record record);


    long getMaxId(Date createDate);

    Long insertRecordForId(Record record);
}
